package com.linciping.room.sample2

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query
import kotlinx.coroutines.flow.Flow

@Dao
interface WorkTypeDao {

    @Query("select * from work_type")
    fun getAll(): Flow<MutableList<WorkType>>

    @Query("select * from work_type where id=:areaId LIMIT 1")
    fun getWorkTypeById(areaId: Long): Flow<WorkType>

    @Insert
    suspend fun insert(area: WorkType): Long

    @Delete
    suspend fun delete(area: WorkType): Int
}